package com.fanfeifei.web.domain.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.UpdateProvider;
import org.springframework.stereotype.Repository;

import com.fanfeifei.web.domain.model.SampleUser;
import com.fanfeifei.web.domain.sqlprovider.SampleUserSqlProvider;

@Repository
public interface SampleUserMapper {
	@Insert("insert into user(account,function,password) values(#{account},#{function},#{password})")
	void insertUser(SampleUser user);

	@UpdateProvider(method = "updateSql", type = SampleUserSqlProvider.class)
	void updateUser(@Param("user") SampleUser user);

	@UpdateProvider(method = "deleteSql", type = SampleUserSqlProvider.class)
	void deleteUser(@Param("user") SampleUser user);

	@Select("select * from user ")
	List<SampleUser> selectUser();

	// this is configed from the mappe.xml file
	List<SampleUser> selectUserAll();
}
